SonarSource Rules
  • Products

    In-IDE

    Code Quality and Security in your IDE with SonarQube Ide

    IDE extension that lets you fix coding issues before they exist!

    Discover SonarQube for IDE

    SaaS

    Code Quality and Security in the cloud with SonarQube Cloud

    Setup is effortless and analysis is automatic for most languages

    Discover SonarQube Cloud

    Self-Hosted

    Code Quality and Security Self-Hosted with SonarQube Server

    Fast, accurate analysis; enterprise scalability

    Discover SonarQube Server
  • SecretsSecrets
  • ABAPABAP
  • AnsibleAnsible
  • ApexApex
  • AzureResourceManagerAzureResourceManager
  • CC
  • C#C#
  • C++C++
  • CloudFormationCloudFormation
  • COBOLCOBOL
  • CSSCSS
  • DartDart
  • DockerDocker
  • FlexFlex
  • GitHub ActionsGitHub Actions
  • GoGo
  • HTMLHTML
  • JavaJava
  • JavaScriptJavaScript
  • JSONJSON
  • JCLJCL
  • KotlinKotlin
  • KubernetesKubernetes
  • Objective CObjective C
  • PHPPHP
  • PL/IPL/I
  • PL/SQLPL/SQL
  • PythonPython
  • RPGRPG
  • RubyRuby
  • RustRust
  • ScalaScala
  • ShellShell
  • SwiftSwift
  • TerraformTerraform
  • TextText
  • TypeScriptTypeScript
  • T-SQLT-SQL
  • VB.NETVB.NET
  • VB6VB6
  • XMLXML
  • YAMLYAML
XML

XML static code analysis

Unique rules to find Bugs and Code Smells in your XML code

  • All rules 37
  • Vulnerability7
  • Bug5
  • Security Hotspot9
  • Code Smell16
 
Tags
    Impact
      Clean code attribute
        1. Defining a single permission for read and write access of content providers is security-sensitive

           Security Hotspot
        2. Allowing application backups is security-sensitive

           Security Hotspot
        3. Requesting dangerous Android permissions is security-sensitive

           Security Hotspot
        4. Using clear-text protocols is security-sensitive

           Security Hotspot
        5. Receiving intents is security-sensitive

           Security Hotspot
        6. Having a permissive Cross-Origin Resource Sharing policy is security-sensitive

           Security Hotspot
        7. Delivering code in production with debug features activated is security-sensitive

           Security Hotspot
        8. Creating cookies without the "HttpOnly" flag is security-sensitive

           Security Hotspot
        9. Hard-coded credentials are security-sensitive

           Security Hotspot

        Requesting dangerous Android permissions is security-sensitive

        intentionality - complete
        security
        Security Hotspot
        • cwe
        • android
        • privacy

        Permissions that can have a large impact on user privacy, marked as dangerous or "not for use by third-party applications" by Android, should be requested only if they are really necessary to implement critical features of an application.

        Ask Yourself Whether

        • It is not sure that dangerous permissions requested by the application are really necessary.
        • The users are not clearly informed why and when dangerous permissions are requested by the application.

        You are at risk if you answered yes to any of those questions.

        Recommended Secure Coding Practices

        It is recommended to carefully review all the permissions and to use dangerous ones only if they are really necessary.

        Sensitive Code Example

        In AndroidManifest.xml:

        <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- Sensitive -->
        <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" /> <!-- Sensitive -->
        

        Compliant Solution

        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- Compliant -->
        

        See

        • OWASP - Top 10 2021 Category A1 - Broken Access Control
        • OWASP - Top 10 2017 Category A3 - Sensitive Data Exposure
        • OWASP - Mobile AppSec Verification Standard - Platform Interaction Requirements
        • OWASP - Mobile Top 10 2016 Category M1 - Improper Platform Usage
        • OWASP - Mobile Top 10 2024 Category M6 - Inadequate Privacy Controls
        • OWASP - Mobile Top 10 2024 Category M8 - Security Misconfiguration
        • CWE - CWE-250 - Execution with Unnecessary Privileges
        • developer.android.com - App permissions best practices
        • Google Play - Privacy, Security, and Deception - Permissions
          Available In:
        • SonarQube IdeCatch issues on the fly,
          in your IDE
        • SonarQube CloudDetect issues in your GitHub, Azure DevOps Services, Bitbucket Cloud, GitLab repositories
        • SonarQube Community BuildAnalyze code in your
          on-premise CI
          Available Since
          9.1
        • SonarQube ServerAnalyze code in your
          on-premise CI
          Developer Edition
          Available Since
          9.1

        © 2008-2025 SonarSource SA. All rights reserved.

        Privacy Policy | Cookie Policy | Terms of Use